doGetBean()
	sharedInstance = getSingleton(beanName); // 从缓存中获取bean
	if(sharedInstance!=null)
		bean = getObjectForBeanInstance(sharedInstance, name, beanName, null); // 是FactoryBean使用FactoryBean.getObject()返回
	else
		if (mbd.isSingleton()) { // 单例
			// 判断缓存中是否存在beanName的bean；没有则createBean()
			sharedInstance = getSingleton(beanName, new ObjectFactory<Object>() {
				@Override
				public Object getObject() throws BeansException {
					return createBean(beanName, mbd, args);
				}
			});
			bean = getObjectForBeanInstance(sharedInstance, name, beanName, mbd);
		}
		else if (mbd.isPrototype()) { // 多例
			// prtotype每次进行将进行createBean()
			Object prototypeInstance = beforePrototypeCreation(beanName); // 创建前操作
			prototypeInstance = createBean(beanName, mbd, args);
			afterPrototypeCreation(beanName); // 创建后操作
			bean = getObjectForBeanInstance(prototypeInstance, name, beanName, mbd);
		}
		else {
			...........................
		}
	
	
	
getObjectForBeanInstance() // 如果bean是FactoryBean类型则返回FactoryBean.getObject()
	// 不是FactoryBean则return
	if (!(beanInstance instanceof FactoryBean)) {
		return beanInstance;
	}
	getObjectFromFactoryBean()=>factory.getObject();

createBean()
	1.执行resolveBeforeInstantiation()让扩展点有机会自定义实例化操作
		1).applyBeanPostProcessorsBeforeInstantiation()
			a.执行所有InstantiationAwareBeanPostProcessor.postProcessBeforeInstantiation()并返回bean
			b.如果bean实例化则执行applyBeanPostProcessorsAfterInitialization()进行初始化after操作
				循环执行BeanPostProcessor.postProcessAfterInitialization()					
	2.如果bean未实例化执行doCreateBean()进行bean实例化
		判断bean是否存在缓存中，不存在则执行createBeanInstance()进行对象实例化
		执行bean的赋值操作populateBean()
			InstantiationAwareBeanPostProcessor.postProcessAfterInstantiation()//通过结果boolean值的反馈可以跳过对属性赋值操作
			执行所有InstantiationAwareBeanPostProcessor.postProcessPropertyValues()//对bean进行赋值
		initializeBean()//执行bean初始化
			invokeAwareMethods()
				if(bean is BeanNameAware)=>BeanNameAware.setBeanName()
				if(bean is BeanClassLoaderAware)=>BeanClassLoaderAware.setBeanClassLoader()
				if(bean is BeanFactoryAware)=>BeanFactoryAware.setBeanFactory()
			applyBeanPostProcessorsBeforeInitialization()
				执行BeanPostProcessor.postProcessBeforeInitialization()
			invokeInitMethods()
				InitializingBean.afterPropertiesSet()
				invokeCustomInitMethod()
			applyBeanPostProcessorsAfterInitialization()
				执行BeanPostProcessor.postProcessAfterInitialization()

				

bean分类
	BeanFactoryPostProcessor
	BeanPostProcessor
		InstantiationAwareBeanPostProcessor
		BeanNameAware
		BeanClassLoaderAware
		BeanFactoryAware
	ApplicationListener
	其他类
	FactoryBean
	LifecycleProcessor
	

refresh()
	prepareRefresh();  // 对refresh进行准备工作
	ConfigurableListableBeanFactory beanFactory = obtainFreshBeanFactory(); // 获取beanFactory
	prepareBeanFactory(beanFactory); // 对beanFactory做些准备工作
	
	try {
		postProcessBeanFactory(beanFactory); // 空方法;目的是使用子类可扩展实现对beanFactory进行处理
		invokeBeanFactoryPostProcessors(beanFactory); // 调用BeanFactoryProcessors
			(BeanFactoryPostProcessor,PriorityOrdered).postProcessBeanFactory(beanFactory);
			(BeanFactoryPostProcessor,Ordered).postProcessBeanFactory(beanFactory);
			(BeanFactoryPostProcessor).postProcessBeanFactory(beanFactory);
		registerBeanPostProcessors(beanFactory); // 注册BeanPostProcessor
			beanFactory.addBeanPostProcessor(BeanPostProcessor,PriorityOrdered)
			beanFactory.addBeanPostProcessor(BeanPostProcessor,Ordered)
			beanFactory.addBeanPostProcessor(BeanPostProcessor)
			beanFactory.addBeanPostProcessor(MergedBeanDefinitionPostProcessor)
			beanFactory.addBeanPostProcessor(ApplicationListenerDetector)
		initMessageSource(); // 初始化MessageSource
			使用默认MessageSource【new DelegatingMessageSource()】
		initApplicationEventMulticaster();
		onRefresh(); // 空方法,可以初始化其他Bean留给子类扩展使用
		registerListeners(); // 注册ApplicationListeners
			ApplicationEventMulticaster.addApplicationListener(listener)
		finishBeanFactoryInitialization(beanFactory); // 注册剩余的Bean
			beanFactory.preInstantiateSingletons() // 实例化剩余bean
				for (String beanName : beanNames) {
					if (isFactoryBean(beanName)) { // 是否是FactoryBean
						// 实例化FactoryBean
						final FactoryBean<?> factory = (FactoryBean<?>) getBean(FACTORY_BEAN_PREFIX + beanName);
						boolean isEagerInit;
						isEagerInit = (factory instanceof SmartFactoryBean &&
								((SmartFactoryBean<?>) factory).isEagerInit());
						if (isEagerInit) { // 是否对实际目标对象进行实例化
							getBean(beanName);
						}
					}
					else {
						getBean(beanName);
					}
				}
		finishRefresh(); // 发布相关事件(ContextRefreshedEvent事件)
			initLifecycleProcessor() //初始化LifecycleProcessor
			getLifecycleProcessor().onRefresh(); // 设置状态
			publishEvent(new ContextRefreshedEvent(this)); // 发布ContextRefreshedEvent
	}catch(BeansException ex) {
		.................
	}
	finally {
		..................
	}